package com.clstu.math_;

public class MathMethod {
    public static void main(String[] args) {
        System.out.println(Math.abs(-5));//5
        System.out.println(Math.pow(2,3));//8.0
        System.out.println(Math.ceil(4.5));//5
        System.out.println(Math.ceil(-4.5));//-4.0
        System.out.println(Math.floor(4.5));//4.0
        System.out.println(Math.floor(-4.5));//-5.0
        System.out.println(Math.round(4.5));//5
        System.out.println(Math.round(4.4));//4
        System.out.println(Math.round(-4.4));//-4
        for (int i = 0; i < 10; i++) {
            System.out.println((int)(2+Math.random()*6));//输出7个2-7内的数
        }

    }
}
